package com.itheima.homework.bh1306;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        //1.键盘录入用户的主题选项
        System.out.println("请选择主题");
        Scanner sc=new Scanner(System.in);
        String choice=sc.next();

        //2.根据用户的选择，匹配对应的格式
        switch (choice){
            default:
                System.out.println("很抱歉，操作有误，已为您切换默认主题");
            case"1":
                System.out.println(new SimpleDateFormat("yyyy年MM月dd日").format(new Date()));
                break;
            case"2":
                System.out.println(new SimpleDateFormat("yyyy-MM-dd").format(new Date()));
                break;
            case"3":
                System.out.println(new SimpleDateFormat("yyyy/MM/dd").format(new Date()));
                break;

        }

    }
}
